home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1997 January
/
Macworld (1997-01).dmg
/
Updaters
/
WDEFLeopard_1_2_3
/
Read Me
next >
Wrap
Text File
|
1996-10-25
|
4KB
|
93 lines
WDEF Leopard 1.2.3
by Maf Vosburgh
25th of October 1996
Price Info
WDEF Leopard is free.
Share and enjoy.
Contact Info
maf@mmcorp.com
http://www.mmcorp.com/~maf
Legal Info
This software is supplied "As Is" without warranty of any kind, and the author does not accept responsibility for any damage it might
accidentally cause.
Info for Normal People
There has been a lot of panic recently about the "WDEF crash" : system error 87.
I wrote this control panel to prevent the problem from happening.
Just drag it to your Control Panels folder and restart. The default options should work fine.
It installs a friendly "WDEF Leopard" who will try to guard your system from harm with her powerful paws.
Info for Geeks
Because of a design limitation in the Window Manager, WDEF resources cannot safely be purgeable.
This is documented, but barely (as pointed out by Robert Thornton).
Here is why they should not be purgeable- if the custom WDEF for a window gets purged, and the Window Manager tries to redraw that
window while the app is in the background, it fails to reload the WDEF code, because it calls LoadResource with the wrong current resource
file.
The Window Manager engineers could fix this by -
a) inserting one line of code (a call to HNoPurge) in their code that loads custom WDEFs,
or
b) inserting a few lines of code around their call to LoadResource so they use the right resource file
or
c) at least publicising the fact that WDEFs should not be purgeable.
In the meantime, this control panel aims to fix the problem by briefly taking control whenever an application is launched and marking the
resources in question non-purgeable. It does not save these changes to disk, so it shouldn't cause problems with updaters, virus checkers,
backup programs etc.
Other resource types
Once I had the code working, I got a bit carried away and added protection for other resource types. By default this is turned off.
Like WDEF resources, MENU resources should not be purgeable. However this is such a rare programming mistake for someone to make
that the check is probably unnecessary. Enable this only if you get system error 84 on a regular basis.
CDEF and MDEF resources probably don't need protection, as the operating system is supposed to be able to reload these as needed..
Enable CDEF protection only if you have problems with system error 88.
Enable MDEF protection only if you have problems with system error 89.
Revision History
Version 1.0
First release.
Version 1.1
I added MDEF, CDEF and MENU resources to the list of types to preload and make unpurgeable.
This has improved the robustness of certain programs considerably when put to the standard test - switch to ZoneRanger, purge the heap of
the target app, then make it redraw while in the background.
Version 1.2
Made it into a Control Panel, so users can choose which resources are preloaded.
Removed the option to preload MENUs, as this crashes ClarisWorks 4.0.
Version 1.2.1
In line with various suggestions made by Robert Thornton, I changed the strategy of the code - it now no longer preloads resources, just
marks them non-purgeable in the resource map. This is faster, uses less memory, and also fixes the previous MENU conflict with
ClarisWorks. That has enabled me to reinstate the MENU protection feature (which protects you from system error 84). The patch on
_InitGraf is now a proper head-patch (don't worry if you don't know what that means).
Version 1.2.2
Made a small change to make the Leopard compatible with old black and white machines with a 68000 processor. People with other Macs
may as well stick with 1.2.1.
Version 1.2.3
Changed the control panel to make the user interface clearer.
The WDEF protection is essential, but the other options are rarely needed. There is now a "Use Defaults" button that turns WDEF protection
on, and turns the other options off.
Added balloon help to state which options tackle which system errors.
Thanks to
Robert Thornton for key information.
Graham Bartram for the name.
Dan Salmon for being the first tester.
Binky and Kevin for being cool.
Vik Rubenfeld for pointing the problem out on Usenet.
Tracy Valleu, Troy Gaul, Robert Thornton and Ric Ford for other info.